import pygame
from pygame.locals import *
from Picture import *
__import__("TouchKeyboard/src/keyboard")

'''Class that implements a main window of one viewer of pictures'''
class MainWindow:
    
    # imageFilename is the name of the file that is the image of the open button
    def __init__(self, imageFilename):
        if not isinstance(imageFilename, str):
            raise TypeError("the filename should be a string, please put the right type")
        self.__buttonOpen = pygame.image.load(imageFilename)
        
    def getButtonOpen(self):
        return self.__buttonOpen
        
    def imageToPicture(self, imageName):
        topLeft = (50, 50)
        return Picture(imageName, topLeft)
        
    def open(self):
        return MTKeyboard().getData